﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using FwProject.ShoppingMall.Com;

namespace FwProject.Com.Dto
{
    /// <summary>
    /// 订单模型
    /// </summary>
    [AutoMap(typeof(ShopOrderDetails))]
    public class ShopOrderDetailsDto:EntityDto<Guid>
    {
        /// <summary>
        /// 订单号
        /// </summary>
        [Display(Name = "订单号")]
        public string OrderNumber { get; set; }

        [Display(Name ="下单时间")]
        public DateTime CreationTime { get; set; }

        /// <summary>
        /// 购买数量
        /// </summary>
        [Display(Name = "购买数量")]
        public int ProductCount { get; set; }

        /// <summary>
        /// 商品编号
        /// </summary>
        [Display(Name = "商品编号")]
        public Guid ShopproductId { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string ShopName { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string SkuName { get; set; }

        /// <summary>
        /// 付款时单价
        /// </summary>
        [Display(Name = "付款时单价")]
        public decimal PayPrice { get; set; }
        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal DiscountPrice { get; set; }

        [Display(Name ="支付金额")]
        public decimal PayAmountPrice { get; set; }
        /// <summary>
        /// 发货时间
        /// </summary>
        [Display(Name = "发货时间")]
        public DateTime? DeliveryTime { get; set; }

        /// <summary>
        /// 订单发货状态
        /// </summary>
        [Display(Name = "订单发货状态")]
        public DeliveryStatus DeliveryStatus { get; set; } = DeliveryStatus.未发货;


        /// <summary>
        /// 评价
        /// </summary>
        [Display(Name = "评价状态")]
        public EvaluateStatus EvaluateStatus { get; set; } = EvaluateStatus.未评价;

        /// <summary>
        /// 供货商结算时间
        /// </summary>
        [Display(Name = "供货商结算时间")]
        public DateTime? SettlementTime { get; set; }

        /// <summary>
        /// 结算状态
        /// </summary>
        [Display(Name = "结算状态")]
        public SettlementStatus SettlementStatus { get; set; } = SettlementStatus.未结算;

        /// <summary>
        /// 退货状态
        /// </summary>
        [Display(Name = "退货状态")]
        public Returngoods Returngoods { get; set; } = Returngoods.未退货;

        /// <summary>
        /// 差价
        /// </summary>
        [Display(Name = "差价")]
        public decimal PriceDifference { get; set; } = 0m;
        
    }

    [AutoMap(typeof(ShopOrderDetails))]
    /// <summary>
    /// 订单明细模型
    /// </summary>
    public class ShopOrderDetailsOutputDto:EntityDto<Guid>
    {
        /// <summary>
        /// 商品名称
        /// </summary>
        public string ShopName { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string SkuName { get; set; }


        /// <summary>
        /// 购买数量
        /// </summary>
        public int ProductCount { get; set; }

        /// <summary>
        /// 付款时的单价
        /// </summary>
        public decimal PayPrice { get; set; }

        /// <summary>
        /// 发货时间
        /// </summary>
        public DateTime? DeliveryTime { get; set; }

        /// <summary>
        /// 优惠金额
        /// </summary>
        public decimal DiscountPrice { get; set; }

        /// <summary>
        /// 发货状态
        /// </summary>
        public DeliveryStatus DeliveryStatus { get; set; }

        /// <summary>
        /// 评价状态
        /// </summary>
        public EvaluateStatus EvaluateStatus { get; set; }

        /// <summary>
        /// 结算状态
        /// </summary>
        public SettlementStatus SettlementStatus { get; set; }

        /// <summary>
        /// 退货状态
        /// </summary>
        public Returngoods Returngoods { get; set; }

        /// <summary>
        /// 差价
        /// </summary>
        public decimal PriceDifference { get; set; }
    }
}
